import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import pinia from './stores'

// 导入样式
import 'element-plus/dist/index.css'
import '@/styles/global.scss'

// 导入Element Plus图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)

// 注册Element Plus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 使用插件
app.use(pinia)
app.use(router)

// 初始化用户状态
import { useUserStore } from '@/stores/user'
const userStore = useUserStore()
userStore.initUserState()

app.mount('#app') 